package io.gitee.luoyuan800.tool.llm.bean.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.gitee.luoyuan800.tool.llm.bean.AbstractMessage;
import lombok.Data;
import lombok.Getter;

import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class ChatRequest {
    private String model;
    private List<AbstractMessage<?>> messages;
    private boolean stream;
    private Double temperature;
    private String stop;
    private Long maxToken;
    private Double frequencyPenalty;
    private Double presencePenalty;
    private String responseFormat = "text";
    private Integer seed;
    private Long maxCompletionTokens;
    private Double penaltyScore;
    private Double topP;
    private Integer n = 1;

    @Getter
    public static enum MessageType {
        TOOL("tool"), SYSTEM("system"), ASSISTANT("assistant"), USER("user");
        private final String id;

        MessageType(String id) {
            this.id = id;
        }
    }
}
